package guoanmaker.operator.business.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import guoanmaker.operator.business.model.OperatorMessage;
import guoanmaker.operator.business.model.OperatorUserSignInLog;


public interface OperatorUserSignInLogRepository extends  JpaRepository<OperatorUserSignInLog, String>, JpaSpecificationExecutor<OperatorUserSignInLog>{
	@Query("select u from OperatorUserSignInLog u  where u.signInActiveId=:signInActiveId  group by perUserId")
	 public List<OperatorUserSignInLog> findByUserSignInLogs(@Param("signInActiveId") String signInActiveId);
	
	@Query("select u from OperatorUserSignInLog u  where u.signInActiveId=:signInActiveId  and u.perUserId=:perUserId  and u.prizeName!='' order by signNumtoDay asc")
	 public List<OperatorUserSignInLog> findByUserSignInLogsByuser(@Param("signInActiveId") String signInActiveId,@Param("perUserId") String perUserId);
}
